#include "toys.h"


Toys::Toys()
{


     this->isloop=false;

     this->m_x=0;
     this->m_y=0;




}

void Toys::loadpix()
{





}

void Toys::toyinit(QString pixpath,QWidget* parent)
{

    this->pltoy.setParent(parent);
    this->pix.load(pixpath);
    this->pltoy.resize(Toy_W,ToY_H);
    this->pltoy.setPixmap(this->pix);
    this->pltoy.setScaledContents(true);
    this->rct.setSize(this->pltoy.size());
    this->pltoy.hide();





}

void Toys::updata()
{

      this->rct.setRect(this->pos.x()+Loop_W/4,this->pos.y()+Loop_H/4,this->pltoy.width()/2,this->pltoy.height()/2);

//     this->rct.setX(this->pos.x());
//     this->rct.setY(this->pos.y());



}
